import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token'

const IndexRoles = 'Index-Roles'

const HasCampOper = 'Index-HasCampOper'

const ExpiresInKey = 'Admin-Expires-In'

const CampJobId = 'camp_job_id'


export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function getRoles() {
  return Cookies.get(IndexRoles)
}

export function setRoles(roles) {
  return Cookies.set(IndexRoles, roles)
}

export function removeRoles() {
  return Cookies.remove(IndexRoles)
}

export function getHasCampOper() {
  return Cookies.get(HasCampOper)
}

export function setHasCampOper(has) {
  return Cookies.set(HasCampOper, has)
}

export function removeHasCampOper() {
  return Cookies.remove(HasCampOper)
}

export function getExpiresIn() {
  return Cookies.get(ExpiresInKey) || -1
}

export function setExpiresIn(time) {
  return Cookies.set(ExpiresInKey, time)
}

export function removeExpiresIn() {
  return Cookies.remove(ExpiresInKey)
}

export function getCampJobId() {
  return Cookies.get(CampJobId)
}

export function setCampJobId(id) {
  return Cookies.set(CampJobId, id)
}

export function removeCampJobId() {
  return Cookies.remove(CampJobId)
}
